// Copyright 2013 Square, Inc.
package org.assertj.ohos.api.widget;

import ohos.agp.components.Image;
import ohos.agp.components.element.Element;
import org.assertj.ohos.api.view.AbstractViewAssert;

import static org.assertj.core.api.Assertions.assertThat;

public class ImageViewAssert extends AbstractViewAssert<ImageViewAssert, Image> {
  public ImageViewAssert(Image actual) {
    super(actual, ImageViewAssert.class);
  }
/* // TODO: wang, not found in ohos
  public ImageViewAssert isAligningBaselineToBottom() {
    isNotNull();
    assertThat(actual.getBaselineAlignBottom()) //
        .overridingErrorMessage("Expected to be aligning baseline to bottom but was not.") //
        .isTrue();
    return this;
  }

  public ImageViewAssert isNotAligningBaselineToBottom() {
    isNotNull();
    assertThat(actual.getBaselineAlignBottom()) //
        .overridingErrorMessage("Expected to not be aligning baseline to bottom but was.") //
        .isFalse();
    return this;
  }

  public ImageViewAssert isCroppingToPadding() {
    isNotNull();
    assertThat(actual.getCropToPadding()) //
        .overridingErrorMessage("Expected to be cropping to padding but was not.") //
        .isTrue();
    return this;
  }

  public ImageViewAssert isNotCroppingToPadding() {
    isNotNull();
    assertThat(actual.getCropToPadding()) //
        .overridingErrorMessage("Expected to not be cropping to padding but was.") //
        .isFalse();
    return this;
  }*/

  public ImageViewAssert hasDrawable(Element drawable) {
    isNotNull();
    Element actualDrawable = actual.getImageElement();
    assertThat(actualDrawable) //
        .overridingErrorMessage("Expected drawable <%s> but was <%s>.", drawable, actualDrawable) //
        .isSameAs(drawable);
    return this;
  }
/* // TODO: wang, not found in ohos
  public ImageViewAssert hasImageAlpha(int alpha) {
    isNotNull();
    int actualAlpha = actual.getImageAlpha();
    assertThat(actualAlpha) //
        .overridingErrorMessage("Expected image alpha <%s> but was <%s>.", alpha, actualAlpha) //
        .isEqualTo(alpha);
    return this;
  }*/

  public ImageViewAssert hasScaleType(Image.ScaleMode type) {
    isNotNull();
    Image.ScaleMode actualType = actual.getScaleMode();
    assertThat(actualType) //
        .overridingErrorMessage("Expected scale type <%s> but was <%s>.", type, actualType) //
        .isEqualTo(type);
    return this;
  }
}
